/*
 * AhaTypes.cpp
 *
 *  Created on: 26 mars 2011
 *      Author: eric
 */

#include "AhaTypes.h"

AhaTypes::AhaTypes() {
}

void AhaTypes::setCanMessage(AhaProtocol::AHA_MSG *ahaMsg, uint16_t nodeAdr,
		uint8_t cidDir, uint16_t cidNvBnd, AhaTypes::AHA_switch *ahaSwitch) {
	ahaMsg->CidTyp = CID_TYP_NV;
	ahaMsg->CidPri = CID_PRI_LOW;
	ahaMsg->CidNodeSrc = nodeAdr;
	ahaMsg->CidDir = cidDir;
	ahaMsg->CidNvBnd = cidNvBnd;
	ahaMsg->nbytes = 2;
	ahaMsg->data[0] = ahaSwitch->state;
	ahaMsg->data[1] = ahaSwitch->value;
}

